﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using DockSample.Line;

namespace DockSample
{
    class StateTransformFlow: ComplexLine
    {
        public StateTransformFlow(Point startPoint, Point endPoint, OriginalDiagram startDiagram, OriginalDiagram endDiagram)
            : base(startPoint, endPoint, startDiagram, endDiagram)
        {
            //LineName = "StateTransformFlow";
        }
        public StateTransformFlow(Point startPoint, Point endPoint, string id, OriginalDiagram startDiagram, OriginalDiagram endDiagram)
            : base(startPoint, endPoint,id, startDiagram, endDiagram)
        {
            //LineName = "StateTransformFlow";
        }
        //***********************************************************************************
        public override void Drawing(Graphics g, DummyModelForm m)
        {
//             Pen pen = new Pen(Color.Brown, 1);
//             Point start = GetStartShowPoint();
//             Point end = GetEndShowPoint();
//             //画箭头
//             double flRlt = Math.Sqrt((start.X - end.X) * (start.X - end.X) + (start.Y - end.Y) * (start.Y - end.Y));
//             float flength = 10;//箭头长度
//             if (flRlt == 0) return;
//             double tmpX = end.X + (start.X - end.X) * flength / flRlt;
//             double tmpY = end.Y + (start.Y - end.Y) * flength / flRlt;
//             double fl1X = (tmpX - end.X) * Math.Sqrt((float)3) / 2 + (tmpY - end.Y) * 1 / 2 + end.X;
//             double fl1Y = (tmpY - end.Y) * Math.Sqrt((float)3) / 2 - (tmpX - end.X) * 1 / 2 + end.Y;
//             double fl2X = (tmpX - end.X) * Math.Sqrt((float)3) / 2 - (tmpY - end.Y) * 1 / 2 + end.X;
//             double fl2Y = (tmpY - end.Y) * Math.Sqrt((float)3) / 2 + (tmpX - end.X) * 1 / 2 + end.Y;
//             g.DrawLine(pen, new Point(end.X, end.Y), new Point((int)fl1X, (int)fl1Y));
//             g.DrawLine(pen, new Point(end.X, end.Y), new Point((int)fl2X, (int)fl2Y)); 
//             //画线
            base.Drawing(g, m);
        }
    }
}
